#pragma once

#define MOUSE_LEFT 1
#define MOUSE_RIGHT 2
#define MOUSE_WHEEL 4

class GlGUIBase;

class MouseEvent
{
private:
  int _buttonPress;
  int _buttonRelease;

public:
  float x, y;
  bool isDrag;
  bool isMove;
  GlGUIBase* target;

  MouseEvent () : x (0), y(0), _buttonPress (0), _buttonRelease (0),
    isDrag (false), isMove (false) {}

  void setButtonPress (int button) { _buttonPress |= button; }
  void setButtonRelease (int button) { _buttonRelease |= button; }

  bool isButtonPress (int button) const { return _buttonPress & button; }
  bool isButtonRelease (int button) const { return _buttonRelease & button; }

  bool hasButtonsPress () const { return (bool) _buttonPress; }
  bool hasButtonsRelease () const { return (bool) _buttonRelease; }
};
